package com.example.easy.mapper;

import com.example.easy.Dto.User;

import com.example.easy.Dto.Visitor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface VisitorMapper {

    @Select("SELECT username FROM visitor  WHERE username=#{username} ")
    String selectUid (String username);//账号

    @Select("SELECT password FROM visitor  WHERE username=#{username} ")
    String selectPsd(String username);//密码

    @Select("SELECT * FROM visitor  WHERE username=#{username} ")
    Visitor selectall(String username);//所有信息

    @Insert("Insert into visitor (username,password,name)Values(#{username},#{password},#{name})")
    void  insVisitor(Visitor visitor);//插入

    @Update("UPDATE visitor SET name=#{name} ,password=#{password} WHERE username=#{username}")
    int update (Visitor visitor);//修改

    @Delete("DELETE FROM visitor WHERE username=#{username}")
    int delete (String username);//删除
}
